home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.image;
-
- import java.io.BufferedInputStream;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
-
- public class FileImageSource extends InputStreamImageSource {
- String imagefile;
-
- public FileImageSource(String var1) {
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- var2.checkRead(var1);
- }
-
- this.imagefile = var1;
- }
-
- final boolean checkSecurity(Object var1, boolean var2) {
- return true;
- }
-
- protected ImageDecoder getDecoder() {
- BufferedInputStream var1;
- try {
- var1 = new BufferedInputStream(new FileInputStream(this.imagefile));
- } catch (FileNotFoundException var4) {
- return null;
- }
-
- int var2 = this.imagefile.lastIndexOf(46);
- if (var2 >= 0) {
- String var3 = this.imagefile.substring(var2 + 1).toLowerCase();
- if (var3.equals("gif")) {
- return new GifImageDecoder(this, var1);
- }
-
- if (var3.equals("jpeg") || var3.equals("jpg") || var3.equals("jpe") || var3.equals("jfif")) {
- return new JPEGImageDecoder(this, var1);
- }
-
- if (var3.equals("xbm")) {
- return new XbmImageDecoder(this, var1);
- }
- }
-
- return ((InputStreamImageSource)this).getDecoder(var1);
- }
- }
-